package com.xiaoke.service;

import com.xiaoke.entity.Address;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
public interface AddressService {

    @GetMapping("/address/delete")
    void delete(@RequestParam("id") String id);

    @PostMapping("/address/insert")
    void insert(@RequestBody Address address);

    @PostMapping("/address/update")
    void update(@RequestBody Address address);

    @GetMapping("/address/detail")
    Map<String, Object> findById(@RequestParam("id") String id);

    @GetMapping("/address/list")
    List<Map<String, Object>> findByUser(@RequestParam("userId") String userId);

    @GetMapping("/address/getDefaultAddress")
    Map<String, Object> getDefaultAddress(@RequestParam("userId") String userId);
}
